<?php 
namespace app\dashboard\validate;
use think\Validate;
class Box extends Base
{
    protected $rule = [
        'id'     => 'require|number|intconvert:id',
        'shipper'     => 'require|strtrim:shipper',
        'shipper_tel'     => 'require|mobile|intconvert:shipper_tel',
        'receiver'          => 'require|strtrim:receiver',
        'receiver_tel'     => 'mobile|intconvert:receiver_tel',
        'receiver_mail'          => 'email|strtrim:receiver_mail',
        'receive_address'          => 'require|strtrim:receive_address',
        'box_number'          => 'require|strtrim:box_number',
        'seal_number'          => 'require|strtrim:seal_number',
        'spec'          => 'require|strtrim:spec',
        'type'          => 'require|strtrim:type',
        'weight'          => 'require|strtrim:weight',
        'port_car_no'          => 'require|strtrim:port_car_no',
        'conveyance_company'          => 'require|strtrim:conveyance_company',
        'arrival_time'     => 'require|number|intconvert:arrival_time',
        'transit_port'     => 'require|strtrim:transit_port',
        'position_box_id'     => 'number|intconvert:position_box_id',
        'position_box'          => 'strtrim:position_box',
        'entrance_time'     => 'number|intconvert:entrance_time',
        'transport_ship_no'          => 'strtrim:transport_ship_no',
        'draw_time'     => 'number|intconvert:draw_time',
        'draw_people'          => 'strtrim:draw_people',
        'sign_time'     => 'number|intconvert:sign_time',
        'sign_people'          => 'strtrim:sign_people',
        'sign_num'          => 'number|strtrim:sign_num',
        'reaching_time'          => 'number|strtrim:reaching_time',
    ];

    protected $message = [
        'id'     => '缺少必要参数',
        'shipper'     => '请填写发货人',
        'shipper_tel'     => '请填写发货人电话',
        'receiver'          => '请填写收货人',
        'receiver_tel'          => '收货人电话格式错误',
        'receiver_mail'          => '邮箱g格式有误',
        'receive_address'          => '请填写收货人地址',
        'box_number'          => '请填写箱号',
        'seal_number'          => '请填写封签号',
        'spec'          => '请填写规格',
        'type'          => '请填写货种',
        'weight'          => '请填写重量',
        'port_car_no'          => '请填写驳船号',
        'conveyance_company'          => '请填写海运公司',
        'arrival_time'     => '请填写预计到达时间',
        'transit_port'     => '请填写中转港口',
        'position_box_id'     => '堆放区域有误',
        'position_box'          => '堆放区域有误',
        'entrance_time'     => '入场时间有误',
        'transport_ship_no'          => '提箱船/车号有误',
        'draw_time'     => '提箱时间有误',
        'draw_people'          => '提箱人有误',
        'sign_time'     => '签收时间有误',
        'sign_people'          => '签收人有误',
        'sign_num'          => '签收数量有误',
        'reaching_time'          => '预计到达目的地的时间错误',
    ];
    
    protected $scene = [
        'add_box' => ['shipper','shipper_tel','receiver','receiver_tel','receiver_mail','receive_address','box_number','seal_number','spec','type','weight','port_car_no','conveyance_company','arrival_time','transit_port','position_box_id','position_box','entrance_time','transport_ship_no','draw_time','draw_people','sign_time','sign_people','sign_num'],
        'edit_box' => ['id','shipper','shipper_tel','receiver','receiver_tel','receiver_mail','receive_address','box_number','seal_number','spec','type','weight','port_car_no','conveyance_company','transit_port','arrival_time','position_box_id','position_box','entrance_time','transport_ship_no','draw_time','draw_people','sign_time','sign_people','sign_num'],
    ];
}

 ?>
